/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.xuexiang.xuidemo.botnavigation;

import ohos.aafwk.ability.fraction.Fraction;

/**
 * 底部对话框中每个条目的数据，泛型对应的是文字的颜色，颜色可以是整型，也可以是字符串，具体是哪种类型的颜色，由调用者来决定
 * *
 *
 * @param <Color>
 * @since 2021-03-22
 */
public class BottomBarInfo<Color> extends TopBottomBarInfo {
    /**
     * 内部类
     *
     * @since 2021-03-22
     */
    public enum BarType {
        /**
         * 显示图片和文案
         */
        IMAGE_TEXT,
        /**
         * 只显示图片
         */
        IMAGE
    }

    /**
     * 条目的名称
     */
    protected String name;
    protected BarType tabType;
    /**
     * 内部类
     *
     * @since 2021-03-22
     */
    public Class<? extends Fraction> fraction;

    /**
     * BottomBarInfo
     *
     * @param name 名字
     * @param defaultImage 图片
     * @param selectedImage 显示的图片
     */
    public BottomBarInfo(String name, int defaultImage, int selectedImage) {
        this.name = name;
        this.defaultImage = defaultImage;
        this.selectedImage = selectedImage;
        this.tabType = BarType.IMAGE;
    }

    /**
     * 不同参数的方法
     *
     * @param name 名字
     * @param defaultImage 图片
     * @param selectedImage 图片
     * @param defaultColor 颜色
     * @param tintColor 颜色
     */
    public BottomBarInfo(String name, int defaultImage, int selectedImage, Color defaultColor, Color tintColor) {
        this.name = name;
        this.defaultImage = defaultImage;
        this.selectedImage = selectedImage;
        this.defaultColor = defaultColor;
        this.tintColor = tintColor;
        this.tabType = BarType.IMAGE_TEXT;
    }
}
